<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./axios.js"></script>
</head>

<body>
    <script>
        let getUrl = 'https://www.easy-mock.com/mock/5b0412beda8a195fb0978627/temp/list'
        let postUrl = 'https://www.easy-mock.com/mock/5b0412beda8a195fb0978627/temp/add'
        // 发送get请求
        axios.get(getUrl, {
            params: { name: 'zs', age: 10 }

        }).then(result => {
            let { data, headers } = result
            console.log(data, headers)
            return axios.get('axios.html', {
                params: {
                    age: 10,
                    id: 20
                }
            })
        }).then(result => {
            let { data } = result
            console.log(data)
            return axios.post(postUrl, {
                age: 10,
                gender: 'male'
            })
        }).then(
            result => {
                let { data, headers } = result
                console.log(data, headers)
            }
        )

    </script>
</body>

</html>